package com.tian.controller;

import com.tian.common.CommonResult;
import com.tian.dto.AppChargingStartReqDto;
import com.tian.dto.AppChargingStopReqDto;
import com.tian.netty.executor.ChargingFlowService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * {@code @description:} TODO
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-08-29 20:15
 * {@code @version:} 1.0
 */
@RestController
@RequestMapping("/charging/core")
public class ChargingController {

    @Resource
    private ChargingFlowService chargingFlowService;
    @PostMapping("/start")
    public CommonResult<Boolean> start(@RequestBody AppChargingStartReqDto appChargingStartReqDto) {
        chargingFlowService.sendStarChargerMsg(appChargingStartReqDto);
        return CommonResult.success();
    }

    @PostMapping("/stop")
    public CommonResult<Boolean> stop(@RequestBody AppChargingStopReqDto appChargingStopReqDto) {
        return CommonResult.success();
    }
}
